﻿@model yq.Search.File.FileListSeek
@Url.Css("Css/metro/css/list.css")
@Url.Script("Scripts/metro/list.js")
<div id="container" class="container">
    @Html.Action("Navigation", "Home")
    @Html.Action("RowLeft", "PublicReuse", new { Area = "Home" })
    <div id="container_r" class="container_right">
        @Html.Action("HeadTitle", "PublicReuse", new { Area = "Home" })
        <div class="icodiv">
            @Html.Button("添加文件夹", new { @class = "btn btn-warning", onclick = "$.AddFile(this)", href = Url.Action("AddFolder") })
            @Html.Button("添加文件", new { @class = "btn btn-info", onclick = "$.AddFile(this)", href = Url.Action("AddFile") })
        </div>
        @using (Ajax.BeginForm("SelectFlie", new { }, new AjaxOptions { UpdateTargetId = "updateid" }, new { @class = "form-horizontal", id = "listform", novalidate = "novalidate" }))
        { 
            <input type="name" id="11" />
            @Html.HiddenFor(obj => obj.SuperiorId)
            <div id="updateid">
                @Html.Action("SelectFlie", "Home", new { search = Model })
            </div>
        }
    </div>
</div>
<script>
    //刷新当前页，superiorId=当前文件夹
    function RefreshForm(superiorId)
    {
        if (superiorId != null)
        {
            $("#SuperiorId").val(superiorId);
        }
        $("#listform").submit();
        return false;
    }


    $.AddFile = function (obj)
    {

        try
        {
            var atr = $(obj).attr("alt");
            var href = $(obj).attr("href");

            $.AjaxServer(href, { SuperiorId: $("#SuperiorId").val() }, function (data)
            {
                var id = newGuid();
                art.dialog({
                    title: atr,
                    id: id,
                    fixed: false,
                    lock: false,
                    content: "<span style='line-height:22px;'>" + _SetDialogContent(data, id) + "</span>",
                    ok: false
                });

                documentCheck();
            });
        }
        catch (e)
        {

        }
        return false;
    }

</script>
